package com.avic.map.dal.mapper;

import com.avic.map.dal.condition.PageQueryShipResourceListCondition;
import com.avic.map.dal.model.ShipResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: huangsheng
 * @date: 2018/9/3
 */
@Mapper
public interface ShipResourceMapper {

    /**
     * 分页查询列表
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    List<ShipResource> itemList(PageQueryShipResourceListCondition pageQueryShipResourceListCondition);

    /**
     * 数据总数
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    int queryRecordsTotal(PageQueryShipResourceListCondition pageQueryShipResourceListCondition);


    /**
     * 新增资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    int insert(ShipResource shipResource);

    /**
     * 根据ID查询信息
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    ShipResource queryItemById(int id);

    /**
     * 根据船舶编号查询单兵信息数量
     *
     * @param shipNumber 船舶编号
     * @return 数据数量
     */
    int queryItemCountByShipNumber(String shipNumber);

    /**
     * 修改资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:23
     */
    int update(ShipResource shipResource);

    /**
     * 删除资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:24
     */
    int delete(int id);

    /**
     * 获取所有船舶
     *
     * @return
     */
    List<ShipResource> queryAllShip();

    /**
     * 更新船舶状态
     *
     * @param shipState
     * @param shipNumber
     * @return
     */
    int updateShipState(@Param("shipState") int shipState, @Param("shipNumber") String shipNumber);

    List<ShipResource> mapVdoShipRecords(@Param("shipNumber") String shipNumber);
}
